use std::fmt;

struct Stu {
    name: String,
    age: u8,
    id: String,
}

impl fmt::Display for Stu {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "name: {}, age: {}, id: {}", self.name, self.age, self.id)
    }
}

fn main() {
    let s = Stu {
        name: String::from("zhangsan"),
        age: 18,
        id: String::from("123456"),
    };

    println!("{}", s)
}
